<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 28644
  Date: 2022/7/29
  Time: 21:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>全部车辆信息</title>
</head>
<style>
    body{
        /* 设置背景渐变 */
        background-image: linear-gradient(to left,
        #9c88ff,#3cadeb);
        display: flex;
        justify-content: center;
    }
    .a{
        position:relative;
        top: 100px;
        width: 1100px;
        height: 550px;
        box-shadow: 0 5px 15px rgba(0,0,0,.8);
        display: flex;
    }
    .b{
        width: 1100px;
        height: 550px;
    }
    table tr td {
        text-align: center;
    }
    <%@ include file="/pages/common/a_style.jsp"%>
</style>
<body>
<div class="a">

    <div class="b">
        <table style="margin: 0 auto; width: 1100px;">
            <p style="text-align: center; color: red">${msg}</p>
            <form action="/User/UserCarServlet?action=userlist" method="post">
            <tr>
                <td>ID</td>
                <td>车牌</td>
                <td>品牌</td>
                <td>模型</td>
                <td>颜色</td>
                <td>款式</td>
                <td>排量</td>
                <td>价格</td>
                <td>价格/小时</td>
                <td>状态</td>
                <td colspan="2">操作</td>
            </tr>
                <c:if test="${not empty requestScope.cars}">
            <c:forEach items="${requestScope.cars}" var="cars">
                <tr>
                    <td>${cars.car_Id}</td>
                    <td>${cars.car_Number}</td>
                    <td>${cars.brand_Name}</td>
                    <td>${cars.model}</td>
                    <td>${cars.color}</td>
                    <td>${cars.category_Name}</td>
                    <td>${cars.t_Comments}</td>
                    <td>${cars.price}</td>
                    <td>${cars.rent}</td>
                    <c:if test="${cars.status == 0}">
                        <td>未出租</td>
                    </c:if>
                    <c:if test="${cars.status == 1}">
                        <td>已出租</td>
                    </c:if>
                    <c:if test="${cars.status == 0}">
                        <td><a href="/User/UserCarServlet?action=Zu&car_Number=${cars.car_Number}">租车</a></td>
                    </c:if>
                    <c:if test="${cars.status == 1}">
                        <td><a href="/User/UserCarServlet?action=Huan&car_Number=${cars.car_Number}">还车</a></td>
                    </c:if>

                </tr>
            </c:forEach>
                </c:if>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td>
                <select name="brand_Name">
                    <option selected = "selected">无</option>
                    <c:forEach begin="0" end="${brands.size()-1}" var="i">
                        <option>${brands[i].name}</option>
                    </c:forEach>
                </select>
            </td>
            <td>
                <select name="category_Name">
                    <option selected = "selected">无</option>
                    <c:forEach begin="0" end="${categories.size()-1}" var="i">
                        <option>${categories[i].name}</option>
                    </c:forEach>
                </select>
            </td>
            <td><a href="/User/UserCarServlet?action=userlist&order=price">价格升序</a></td>
            <td><a href="/User/UserCarServlet?action=userlist&order=price desc">价格降序</a></td>
            <td><input type="submit"></td>
            </form>
        </table>
    </div>
</div>
</body>
</html>
